package com.efruit.poadapters;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.efruit.shopcart.IProductInfoFetcher;
import com.efruit.shopcart.ShopCartFactory;

public class ShopCartFactoryImpl extends ShopCartFactory{

	private SCProductInfoFetcherImpl scProductInfoFetcherImpl;
	@Override
	public IProductInfoFetcher getProductInfoFetcher() {
		if (scProductInfoFetcherImpl == null) {
			ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
			scProductInfoFetcherImpl = (SCProductInfoFetcherImpl) ctx.getBean("SCProductInfoFetcherImpl");
		}
		return scProductInfoFetcherImpl;
	}

}
